package com.aspose.cells;

class zaxc extends zaxa {
   private zut c;
   private int d;
   private int e;
   private short f;
   private int g;
   private int h = -1;
   private boolean i = false;
   private int j;
   private int k;
   private int l;
   private int m;
   private zagu n;

   public zaxc(zaay var1, zut var2, int var3, int var4, int var5) {
      super(var1);
      this.c = var2;
      this.d = var4;
      this.e = var5;
      this.f = (short)var3;
      this.j = var2.d(var4);
      if (this.j < 0) {
         this.j = -this.j - 1;
      }

      this.k = var2.d(var5);
      if (this.k < 0) {
         this.k = -this.k - 2;
      }

      if (this.k < this.j) {
         this.i = true;
         this.j = -1;
         this.k = -1;
         this.l = -1;
         this.m = -1;
      } else if (this.k == this.j) {
         this.i = true;
         zuq var6 = var2.b(this.j);
         this.n = this.a(var6, var3);
         if (this.n != zzk.a) {
            this.l = var6.a() - this.d;
            this.m = this.l;
            this.h = this.l;
         } else {
            this.j = -1;
            this.k = -1;
            this.l = -1;
            this.m = -1;
         }
      } else {
         this.l = var2.b(this.j).a() - this.d;
         this.m = var2.b(this.k).a() - this.d;
         this.g = this.j - 1;
      }

   }

   private zaxc(zaxc var1, zaay var2) {
      super(var2 == null ? var1.a : var2);
      this.c = var1.c;
      this.d = var1.d;
      this.e = var1.e;
      this.f = var1.f;
      this.h = var1.h;
      this.i = var1.i;
      this.j = var1.j;
      this.k = var1.k;
      this.l = var1.l;
      this.m = var1.m;
      this.n = var1.n;
   }

   public zahn b(zaay var1) {
      return new zaxc(this, var1);
   }

   public int c() {
      return this.e - this.d + 1;
   }

   public int d() {
      return 1;
   }

   public int e() {
      return this.c();
   }

   public boolean l() {
      return false;
   }

   public boolean m() {
      return false;
   }

   public boolean n() {
      return true;
   }

   public zagu a(int var1, int var2) {
      if (var1 >= this.l && var1 <= this.m) {
         if (this.l == this.m) {
            return this.n;
         } else {
            int var3 = this.c.d(var1 + this.d);
            return (zagu)(var3 < 0 ? zzk.a : this.a(this.c.b(var3), this.f));
         }
      } else {
         return null;
      }
   }

   public void f() {
      if (this.j > -1) {
         this.g = this.j - 1;
      } else {
         this.g = 0;
      }

   }

   public boolean b(int var1, int var2) {
      return this.a(var1);
   }

   public boolean a(int var1) {
      if (var1 > this.m) {
         return false;
      } else if (this.l == this.m) {
         this.g = 0;
         return true;
      } else if (this.h == var1) {
         return true;
      } else {
         if (this.h > var1) {
            this.g = this.j;
         } else {
            ++this.g;
         }

         for(var1 += this.d; this.g <= this.k; ++this.g) {
            zuq var2 = this.c.b(this.g);
            if (var2.a() >= var1) {
               this.n = this.a(var2, this.f);
               if (this.n != zzk.a) {
                  this.h = var2.a() - this.d;
                  return true;
               }
            }
         }

         return false;
      }
   }

   public boolean g() {
      if (this.l < 0) {
         return false;
      } else if (this.l == this.m) {
         if (this.g < 0) {
            return false;
         } else {
            this.g = -1;
            return true;
         }
      } else if (this.g >= this.k) {
         return false;
      } else {
         ++this.g;
         zuq var1 = this.c.b(this.g);
         this.n = this.a(var1, this.f);
         if (this.n != zzk.a) {
            this.h = var1.a() - this.d;
            return true;
         } else {
            ++this.g;

            while(this.g <= this.k) {
               var1 = this.c.b(this.g);
               this.n = this.a(var1, this.f);
               if (this.n != zzk.a) {
                  this.h = var1.a() - this.d;
                  return true;
               }

               ++this.g;
            }

            return false;
         }
      }
   }

   public zagu h() {
      return this.n;
   }

   public int i() {
      return this.h;
   }

   public int j() {
      return 0;
   }

   public int k() {
      return this.h;
   }

   public zahn b(int var1) {
      int var2 = this.c.d(var1 + this.d);
      return var2 < 0 ? new zaya((zagu)null) : new zaya(this.a(this.c.b(var2), this.f));
   }

   public zahn c(int var1) {
      return this;
   }

   public boolean q() {
      return this.i;
   }

   public int r() {
      if (!this.i) {
         this.C();
      }

      return this.l;
   }

   public int s() {
      if (!this.i) {
         this.C();
      }

      return this.m;
   }

   public int t() {
      if (!this.i) {
         this.C();
      }

      return this.l < 0 ? -1 : 0;
   }

   public int u() {
      if (!this.i) {
         this.C();
      }

      return this.l < 0 ? -1 : 0;
   }

   public int v() {
      if (!this.i) {
         this.C();
      }

      return this.l;
   }

   public int w() {
      if (!this.i) {
         this.C();
      }

      return this.m;
   }

   private void C() {
      this.i = true;

      for(this.g = this.j; this.g <= this.k; ++this.g) {
         zuq var1 = this.c.b(this.g);
         this.n = this.a(var1, this.f);
         if (this.n != zzk.a) {
            this.j = this.g;
            this.l = var1.a() - this.d;
            if (this.g < this.k) {
               for(this.g = this.k; this.g > this.j; --this.g) {
                  var1 = this.c.b(this.g);
                  this.n = this.a(var1, this.f);
                  if (this.n != zzk.a) {
                     this.k = this.g;
                     this.m = var1.a() - this.d;
                     return;
                  }
               }
            }

            this.k = this.j;
            this.m = this.l;
            this.h = this.l;
            return;
         }
      }

      this.j = -1;
      this.k = -1;
      this.l = -1;
      this.m = -1;
   }
}
